<template>
  <div class="less-stock-list">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span style="font-size: 18px; font-weight: 600">急缺库存</span>
        <el-button
          style="float: right; padding: 3px 0; color: #999999 !important"
          type="text"
          @click="viewMoreStock"
          >查看更多</el-button
        >
      </div>
      <el-table :data="lessStockList" style="width: 100%">
        <el-table-column prop="skuNo" label="商品编号" width="180">
        </el-table-column>
        <el-table-column prop="skuName" label="商品名称" width="420">
        </el-table-column>
        <el-table-column prop="inventory" label="库存数量"> </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'less-stock-list',
  data() {
    return {
      lessStockList: [],
    }
  },
  mounted() {
    this.queryLessStockList()
  },
  methods: {
    queryLessStockList() {
      this.$http({
        url: this.$http.adornUrl('/mall/workbench/stock/less'),
        method: 'get',
        params: this.$http.adornParams({
          page: 0,
          limit: 9,
        }),
      }).then(({ data }) => {
        this.lessStockList = data.page.list
      })
    },
    viewMoreStock() {
      this.$router.push('/repetory-stock-order')
    },
  },
}
</script>

<style scoped>
</style>
